package com.studentmanage.manage_college.controller;

import com.studentmanage.api.college.CollegeControllerApi;
import com.studentmanage.framework.domain.base.College;
import com.studentmanage.framework.domain.common.response.ResponseResult;
import com.studentmanage.framework.domain.common.response.ResponseValue;
import com.studentmanage.manage_college.service.CollegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/college")
public class CollegeController implements CollegeControllerApi {
    @Autowired
    private CollegeService collegeService;

    @Override
    @PostMapping("/add")
    public ResponseResult addCollege(@RequestBody College college) {
        return collegeService.addCollege(college);
    }

    @Override
    @GetMapping("/get/{id}")
    public ResponseValue<College> findCollegeById(@PathVariable("id") String id) {
        return collegeService.findCollegeById(id);
    }
}
